var limsSamplecodeGenerate = Gikam.getPageObject({

    getEditListColumns: function () {
        return [{
            checkbox: true
        }, {
            index: true
        }, {
            field: 'generateBatchCode',
            title: 'T_LIMS_SAMPLECODE_GENERATE.GENERATEBATCHCODE',
            width: 120
        }, {
            field: 'barcodeNum',
            title: 'T_LIMS_SAMPLECODE_GENERATE.BARCODENUM',
            width: 120
        }, {
            field: 'ext$.cnt_notinuse',
            title: 'T_LIMS_SAMPLECODE_GENERATE.CNT_NOT_IN_USE',
            width: 120
        }, {
            field: 'createdByName',
            title: 'T_LIMS_SAMPLECODE_GENERATE.OPERATOR',
            width: 120
        }, {
            field: 'createdTime',
            title: 'T_LIMS_SAMPLECODE_GENERATE.OPERATETIME'
        }];
    },

    getBaseInfoFormFields: function () {
        return [{
            field: 'generateBatchCode',
            title: 'T_LIMS_SAMPLECODE_GENERATE.GENERATEBATCHCODE',
            validators: ['strLength[0,16]']
        }, {
            field: 'barcodeNum',
            title: 'T_LIMS_SAMPLECODE_GENERATE.BARCODENUM',
            validators: ['number', 'notEmpty'],
            preInsert: true,
            type: 'select',
            category: 'sys',
            param: {
                codeCategoryId: 'samplecode-barcodeNum'
            },
            firstBlank: false
        }];
    },

    getChooseListColumns: function () {
        return [{
            field: 'generateBatchCode',
            title: 'T_LIMS_SAMPLECODE_GENERATE.GENERATEBATCHCODE'
        }, {
            field: 'barcodeNum',
            title: 'T_LIMS_SAMPLECODE_GENERATE.BARCODENUM'
        }, {
            field: 'operator',
            title: 'T_LIMS_SAMPLECODE_GENERATE.OPERATOR'
        }, {
            field: 'operateTime',
            title: 'T_LIMS_SAMPLECODE_GENERATE.OPERATETIME'
        }];
    },

    baseUrl: IFM_CONTEXT + '/secure/baseline/samplemanage/samplecode-generates',

    getRecordEditListColumns: function () {
        return [{
            checkbox: true
        }, {
            index: true
        }, {
            field: 'generateSampleCode',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.GENERATESAMPLECODE',
            width: 140
        }, /*{
            field: 'printedCount',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.PRINTEDCOUNT',
            width: 140
        },*/ {
            field: 'ext$.inuseflag',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.USEDFLAG',
            type: 'select',
            category: 'sys',
            param: {
                codeCategoryId: 'yesorno'
            },
            width: 140,
            styleFormatter: function (row) {
                if (row.ext$.inuseflag === '1') {
                    return {
                        backgroundColor: 'green'
                    }
                }
            },
        }, {
            field: 'remark',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.REMARK',
            editor: true,
            width: 140
        }]
    },

    getRecordBaseInfoFormFields: function () {
        return [{
            field: 'generateSampleCode',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.GENERATESAMPLECODE',
            validators: ['strLength[0,33]']
        }, {
            field: 'printedCount',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.PRINTEDCOUNT'
        }, {
            field: 'remark',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.REMARK',
            validators: ['strLength[0,100]']
        }];
    },

    getRecordChooseListColumns: function () {
        return [{
            field: 'generateSampleCode',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.GENERATESAMPLECODE'
        }, {
            field: 'printedCount',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.PRINTEDCOUNT'
        }, {
            field: 'remark',
            title: 'T_LIMS_SAMPLECODE_GENERATE_RECORD.REMARK'
        }];
    },

    baseRecordUrl: IFM_CONTEXT + '/secure/baseline/samplemanage/samplecode-generate-records'
});
